package
{
	import com.freshcity.component.container.HBox;
	import com.freshcity.component.container.VBox;
	import com.freshcity.component.FLabel;
	
	import flash.display.Sprite;

	[SWF(width="790", height="570", frameRate="30",wmode="direct")]
	public class Test extends Sprite
	{
		[Embed(source='../assets/level-1.png')]
		public var Level1Img:Class;		
		[Embed(source='../assets/level-2.png')]
		public var Level2Img:Class;		
		[Embed(source='../assets/level-3.png')]
		public var Level3Img:Class;		
		private var mainBox:VBox;
		
		public function Test()
		{
			mainBox = new VBox();
			
			for (var i:int = 20; i < 100; i++) 
			{
				fname(i);
			}
			
			mainBox.initialize();
			addChild(mainBox);
		}
		
		private function fname(level:int):void
		{
			var box:HBox = new HBox();
			box.spacing = 0;
			var level3:int = level/13;
			for (var i:int = 0; i < level3; i++) 
			{
				box.addChild(new Level3Img());
			}
			level -= level3*13;
			var level2:int = level/4;
			for (var j:int = 0; j < level2; j++) 
			{
				box.addChild(new Level2Img());
			}
			level -= level2*4;
			var level1:int = level;
			for (var x:int = 0; x < level1; x++) 
			{
				box.addChild(new Level1Img());
			}
			box.initialize();
			
			mainBox.addChild(box);
		}
	}
}